home *** CD-ROM | disk | FTP | other *** search
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Display;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.midlet.MIDlet;
-
- public class Linelet extends MIDlet implements CommandListener {
- private LineCanvas myCanvas = new LineCanvas(this);
- private Command exitCommand = new Command("Exit", 7, 2);
-
- public Linelet() {
- this.myCanvas.addCommand(this.exitCommand);
- this.myCanvas.setCommandListener(this);
- }
-
- public void startApp() {
- try {
- Display.getDisplay(this).setCurrent(this.myCanvas);
- this.myCanvas.startProcess();
- } catch (Exception var2) {
- System.out.println(((Throwable)var2).getMessage());
- }
-
- }
-
- public void pauseApp() {
- }
-
- public void destroyApp(boolean var1) {
- }
-
- public void commandAction(Command var1, Displayable var2) {
- if (var1 == this.exitCommand) {
- this.destroyApp(false);
- ((MIDlet)this).notifyDestroyed();
- }
-
- }
- }
-